﻿<%@ Page Title="Cadastro de Fornecedor" Language="C#" MasterPageFile="~/SiteCadastro.master" AutoEventWireup="true" CodeBehind="FornecedorView.aspx.cs" Inherits="ASPPanificadora.Telas.FornecedorView" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="form" runat="server">
<h1>Cadastro de Fornecedor</h1>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
    <br />
    <p>
        <asp:Label Text="Código:" runat="server" Width="300"/>
        <asp:TextBox ID="txtCodigo" runat="server" Width="300"  CssClass="textBox" 
            Enabled="False">0</asp:TextBox>
    </p>
    <p>
        <asp:Label Text="Nome Fornecedor" runat="server" Width="300"/>
        <asp:TextBox ID="txtNomeFornecedor" runat="server" Width="300" CssClass="textBox" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtNomeFornecedor" ErrorMessage="*Obrigatório" ForeColor="Red" />
    </p>
    <p>
        <asp:Label Text="Razão Social" runat="server" Width="300"/>
        <asp:TextBox ID="txtRazaoSocial" runat="server" Width="300" CssClass="textBox" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtRazaoSocial" ErrorMessage="*Obrigatório" ForeColor="Red" />
    </p>
    <p>
        <asp:Label Text="CNPJ" runat="server" Width="300"/>
        <asp:TextBox ID="txtCnpj" runat="server" Width="300" CssClass="textBox" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtCnpj" ErrorMessage="*Obrigatório" ForeColor="Red" />
        <cc1:MaskedEditExtender ID="MskCnpj" runat="server" Mask="99,999,999/9999-99" TargetControlID="txtCnpj" InputDirection="LeftToRight" ClearMaskOnLostFocus="False" />
        <asp:RegularExpressionValidator runat="server" 
            ErrorMessage="*Preenchimento inválido" ForeColor="Red" 
            ControlToValidate="txtCnpj" 
            ValidationExpression="\d{2,3}.?\d{3}.?\d{3}/?\d{4}-?\d{2}"></asp:RegularExpressionValidator>
    </p>
    <p>
        <asp:Label Text="Endereço" runat="server" Width="300"/>
        <asp:TextBox ID="txtRua" runat="server" Width="300" CssClass="textBox" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtRua" ErrorMessage="*Obrigatório" ForeColor="Red" />
    </p>
    <p>
        <asp:Label Text="Bairro" runat="server" Width="300"/>
        <asp:TextBox ID="txtBairro" runat="server" Width="300" CssClass="textBox" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtBairro" ErrorMessage="*Obrigatório" ForeColor="Red" />
    </p>
    <p>
        <asp:Label Text="Número" runat="server" Width="300" />
        <asp:TextBox ID="txtNumero" runat="server" Width="300" CssClass="textBox" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtNumero" ErrorMessage="*Obrigatório" ForeColor="Red" />
    </p>
    <p>
        <asp:Label Text="CEP" runat="server" Width="300" />
        <asp:TextBox ID="txtCep" runat="server" Width="300" CssClass="textBox"/>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCep" ErrorMessage="*Obrigatório" ForeColor="Red" />
        <cc1:MaskedEditExtender ID="MskCep" runat="server" Mask="99,999-999" TargetControlID="txtCep" InputDirection="LeftToRight" ClearMaskOnLostFocus="False" />
        <asp:RegularExpressionValidator runat="server" 
            ErrorMessage="*Preenchimento inválido" ForeColor="Red" 
            ControlToValidate="txtCep" 
            ValidationExpression="\d{2}.?\d{3}-?\d{3}"></asp:RegularExpressionValidator>
    </p>
    <p>
        <asp:Label Text="Telefone Comercial" runat="server" Width="300"/>
        <asp:TextBox ID="txtTelefoneComercial" runat="server" Width="300" CssClass="textBox" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtTelefoneComercial" ErrorMessage="*Obrigatório" ForeColor="Red" />
        <cc1:MaskedEditExtender ID="MskTelefoneComercial" runat="server" Mask="(99)9999-9999" TargetControlID="txtTelefoneComercial" InputDirection="LeftToRight" ClearMaskOnLostFocus="False" />
        <asp:RegularExpressionValidator runat="server" 
            ErrorMessage="*Preenchimento inválido" ForeColor="Red" 
            ControlToValidate="txtTelefoneComercial" 
            ValidationExpression="^\(?\d{2}\)?[\s-]?\d{4}-?\d{4}$"></asp:RegularExpressionValidator>
    </p>
    <p>
        <asp:Label Text="Telefone Celular" runat="server" Width="300"/>
        <asp:TextBox ID="txtTelefoneCelular" runat="server" Width="300" CssClass="textBox" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtTelefoneCelular" ErrorMessage="*Obrigatório" ForeColor="Red" />        
        <cc1:MaskedEditExtender ID="MskTelefoneCelular" runat="server" Mask="(99)9999-9999" TargetControlID="txtTelefoneCelular" InputDirection="LeftToRight" ClearMaskOnLostFocus="False" />
        <asp:RegularExpressionValidator runat="server" 
            ErrorMessage="*Preenchimento inválido" ForeColor="Red" 
            ControlToValidate="txtTelefoneCelular" 
            ValidationExpression="^\(?\d{2}\)?[\s-]?\d{4}-?\d{4}$"></asp:RegularExpressionValidator>
    </p>
    <p>
        <asp:Label Text="Email" runat="server" Width="300"/>
        <asp:TextBox ID="txtEmail" runat="server" Width="300" CssClass="textBox" />
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
            ErrorMessage="*Preenchimento inválido" ForeColor="Red" 
            ControlToValidate="txtEmail" ValidationExpression="^([0-9a-zA-Z]+([_.-]?[0-9a-zA-Z]+)*@[0-9a-zA-Z]+[0-9,a-z,A-Z,.,-]*(.){1}[a-zA-Z]{2,4})+$"></asp:RegularExpressionValidator>
    </p>
    <p>
        <asp:Label Text="Site" runat="server" Width="300"/>
        <asp:TextBox ID="txtSite" runat="server" Width="300" CssClass="textBox" />
        <asp:RegularExpressionValidator runat="server" 
            ErrorMessage="*Preenchimento inválido" ForeColor="Red" 
            ControlToValidate="txtSite" ValidationExpression="^(www\.)?[a-zA-Z0-9-\.]+\.(com|org|net|mil|edu|ca|co.uk|com.au|gov|br)$"></asp:RegularExpressionValidator>
    </p>
        <div style="height:40px;">
            <asp:UpdatePanel ID="udpPais" runat="server">
                <ContentTemplate>
                    <asp:Label Text="País" runat="server" Width="300"/>
                    <asp:DropDownList ID="ddlPais" runat="server" Width="300" 
                        onselectedindexchanged="ddlPais_SelectedIndexChanged" AutoPostBack="True"/>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ddlPais" ErrorMessage="*Obrigatório" ForeColor="Red" InitialValue="0" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>   
        <div style="height:40px;">
            <asp:UpdatePanel ID="udpEstado" runat="server">
                <ContentTemplate>
                    <asp:Label Text="UF" runat="server" Width="300"/>
                    <asp:DropDownList ID="ddlEstado" runat="server" Width="300" AutoPostBack="True" 
                        onselectedindexchanged="ddlEstado_SelectedIndexChanged"/>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ddlEstado" ErrorMessage="*Obrigatório" ForeColor="Red" InitialValue="0" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <div style="height:30px;">
            <asp:UpdatePanel ID="udpCidade" runat="server">
                <ContentTemplate>
                    <asp:Label ID="Label1" Text="Cidade" runat="server" Width="300"/>
                    <asp:DropDownList ID="ddlCidade" runat="server" Width="300"/>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ddlCidade" ErrorMessage="*Obrigatório" ForeColor="Red" InitialValue="0" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    <p>
        <asp:Label Text="Tipo Fornecedor" runat="server" Width="300"/>
        <asp:DropDownList ID="ddlTipoFornecedor" runat="server" Width="300"/>
        <asp:RequiredFieldValidator runat="server" ControlToValidate="ddlTipoFornecedor" ErrorMessage="*Obrigatório" ForeColor="Red" InitialValue="0" />
    </p>
    <p>
        <asp:Label Text="Ativo" runat="server" Width="300"/>
        <asp:CheckBox ID="ckbAtivo" runat="server" Checked="true"/>
    </p>
    </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="grid" runat="server">
</asp:Content>